<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html>
<head>
		<title>送车员表单</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
       <%--  <link rel="stylesheet" href="<%=path%>/css/lightbox.css" /> --%>
		<link rel="stylesheet" href="<%=path%>/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=path%>/css/font-awesome.css" />
        <link rel="stylesheet" href="<%=path%>/css/jquery-ui.css" />
		<link rel="stylesheet" href="<%=path%>/css/icheck/flat/blue.css" />
		<link rel="stylesheet" href="<%=path%>/css/select2.css" />		
		<link rel="stylesheet" href="<%=path%>/css/unicorn.css" />
		<link rel="stylesheet" href="<%=path%>/css/mx.css" />
		<script type="text/javascript" src="<%=path%>/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="<%=path%>/js/source/jquery.fancybox.js?v=2.1.3"></script>
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/source/jquery.fancybox.css?v=2.1.2" media="screen" />
		<!--[if lt IE 9]>
		<script type="text/javascript" src="js/respond.min.js"></script>
		<![endif]-->
		<%-- <script src="<%=path%>/js/jquery.min.js"></script> --%>
	<script>
		  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
		  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
		  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
		  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

		  ga('create', 'UA-44987299-1', 'bootstrap-hunter.com');
		  ga('send', 'pageview');
		 
		</script>
		<style type="text/css">
		.layui-layerst {
			width:600px;
			heght:500px;
		}
	</style>
</head>	
<body data-color="grey" class="flat">
		<div id="wrapper">
			<div id="header">
				<h1><a href="<%=path %>/admins/index">宣 臻  管 理</a></h1>	
				<a id="menu-trigger" href="#"><i class="fa fa-bars"></i></a>	
			</div>
		
			<div id="user-nav">
	            <ul class="btn-group">
	            	<li class="btn" ><a title="" href="#"><i class="fa fa-user"></i> <span class="text">${admins.userName}</span></a></li>
	          
	                <li class="btn"><a title="" href="<%=path%>/admins/out"><i class="fa fa-share"></i> <span class="text">登出</span></a></li>
	            </ul>
	        </div>
	       
	       

			<div id="sidebar">
				<div id="search">
					<!-- <input type="text" placeholder="Search here..."/><button type="submit" class="tip-right" title="Search"><i class="fa fa-search"></i></button> -->
				</div>	
				<ul>
					<li ><a href="<%=path%>/admins/jielong"><i class="fa fa-th"></i> <span>接龙用户表单</span></a></li>
					<li ><a href="<%=path%>/admins/dating"><i class="fa fa-th"></i> <span>快闪交友用户表单</span></a></li>
					<li ><a href="<%=path%>/admins/datingcount"><i class="fa fa-th"></i> <span>快闪交友数据统计</span></a></li>
					<li ><a href="<%=path%>/reserManage/show"><i class="fa fa-th"></i> <span>car2go 约车调度</span></a></li>
					<li class="active"><a href="<%=path%>/reserManage/postman"><i class="fa fa-th"></i> <span>送车员任务统计</span></a></li>
					<li ><a href="<%=path%>/reserManage/blackUserList"><i class="fa fa-th"></i> <span>黑名单管理</span></a></li>
					<li ><a href="<%=path%>/redPacket/showList"><i class="fa fa-th"></i> <span>红包列表</span></a></li>
					
				</ul>
			
			</div>
		
		
		
		<div id="content">
			<div id="breadcrumb">
				<a href="#" title="Go to Home" class="tip-bottom"><i class="fa fa-home"></i>管理</a>
				<a href="#" class="current">送车员表单</a>
			</div>
				<div class="row" style="width:;">
					<div class="col-xs-12">
						
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="fa fa-th"></i>
								</span>
								<h5>送车员列表</h5>
							</div>
							<div class="widget-content  nopadding">
								<table class="table table-bordered table-striped table-hover data-table" style="text-align: center;">
									<thead>
									<tr>
								<!-- 	<th><input type="checkbox" id="title-table-checkbox" name="title-table-checkbox" /></th> -->
									<th>序号</th>
									<th>送车员</th>
									<th>登&nbsp;录&nbsp;名</th>
									<th>总订单</th>
									<th>派送中订单</th>
									<th></th>
						
									</tr>
									</thead>
									<tbody>
										<c:forEach items="${postManList}" var="list" varStatus="s">
											<tr class="plist" style="vertical-align:middle;">
												<td class="rid" style="vertical-align:middle;">${list.id}</td>
												<td style="vertical-align:middle;">${list.name}</td>
												<td style="vertical-align:middle;">${list.phone}</td>
												<td style="vertical-align:middle;">${list.acceptCount}</td>
												<td style="vertical-align:middle;">${list.unfinishCount}</td>
												<td style="vertical-align:middle;">
													<a href="javascript:;" ><button name="target" class="btn btn-dark-blue btn-sm busy" style="margin-right:0px;">查看派送中订单</button></a>
												</td>
											</tr>
										</c:forEach>
									</tbody>
									</table>
							</div>
						</div>
					</div>
				</div>
		</div>
		<div class="row">
			<div id="footer" class="col-xs-12">
				XUANZHEN&nbsp; 2012 - 2013 &copy; Unicorn Admin. Brought to you 
			</div>
		</div>
		
            
            <script src="<%=path%>/js/jquery-ui.custom.js"></script>
            <script src="<%=path%>/js/bootstrap.min.js"></script>
            <script src="<%=path%>/js/jquery.icheck.min.js"></script>
            <script src="<%=path%>/js/select2.min.js"></script>
            <script src="<%=path%>/js/jquery.dataTables.min.js"></script>      
            <script src="<%=path%>/js/jquery.nicescroll.min.js"></script>
            <script src="<%=path%>/js/unicorn.js"></script>
            <script src="<%=path%>/js/unicorn.tables.js"></script>
             <script src="<%=path%>/js/layer/layer.js"></script>
               <script type="text/javascript">
               (function(global,$){ 
	            	 $("td a").css({"display":"block","float":"left","margin":"auto 5px"}); 
	 
	            //点击查看最近派送中单
	            	  $(document).on("click",".busy",function(){
	            		  var ids = $(this).closest('.plist').find(".rid").text(); 
	                 		 $.ajax({  
	        				    	 type: "post",
	        			             url:"<%=path%>/reserManage/postManTask", 
	        			           	 data: {id:ids},
	        			             dataType: "json",
	        			   			async:false,
	        			             timeout: 10000,  
	        			             cache: false,  
	        			             error: errorFunction,  //错误执行方法    
	        			             success: successFunction //成功执行方法    
	        			         });
	                		  function errorFunction() {  
	      			              alert("系统忙，请稍后重试");
	      			              return false;
	      			         }
	                		 function successFunction(data) {
	                			 var json = eval(data);
	    						 result = '<div class="widget-box">'
	    							+'<div class="widget-title">'
	    						+'<span class="icon">'
	    							+'<i class="fa fa-th"></i>'
	    						+'</span>'
	    						+'<h5>送&nbsp;&nbsp;车&nbsp;&nbsp;任&nbsp;&nbsp;务&nbsp;：</h5>'
	    					+'</div>'
	    					+'<div class="widget-content">'
	    						+'<table class="table table-bordered table-striped table-hover data-table">'
	    							+'<thead>'
	    								+'<tr>'
	    								+'<th>序号</th>'
	    								+'<th>预约用户</th>'
	    								+'<th>约车手机</th>'	
	    								+'<th>交车地址</th>'
	    								+'<th>送车时间</th>'
	    								+'</tr>'
	    							+'</thead>'
	    							+'<tbody>';
	                        	$.each(json, function (index, item) {
	                        		var record =new Object(); 
	                        		record.id=json[index].id;
	                              	record.name= json[index].name;
	        	                   	record.phone=json[index].phone;
	        	                	record.address=json[index].address;
	        	                	record.time=getNowFormatDate(json[index].time);
	        	                   	result+='<tr class="plist" style="text-align:center;vertical-align:middle;">'
	        	                   	+'<td class="">'+record.id+'</td>'
	        	                   	+'<td class="">'+record.name+'</td>'
	        	                   	 +'<td>'+record.phone+'</td>' 
	        	                   	+'<td>'+record.address+'</td>'
	        	                   	+'<td>'+record.time+'</td>';
	        	                   	
	                        	})
	                        	result+='</tbody></table></div></div>'
	                        		layer.open({
	                        		area: '600px;',
	                           	     type: 1,
	                           	     title: "正在进行任务",
	                           	     closeBtn: 0,
	                           	     shadeClose: true,
	                           	     skin: 'layui-layerst',
	                           	     content: '<div style="width:600px;">'
	                           	     +result
	                           	     +'</div>'
	                           	   });
	                		 }  
	            	  });
	            	  function getNowFormatDate(time) {
						    var date = new Date(time);
						    var seperator1 = "-";
						    var seperator2 = ":";
						    var year = date.getFullYear();
						    var month = date.getMonth() + 1;
						    var strDate = date.getDate();
						    if (month >= 1 && month <= 9) {
						        month = "0" + month;
						    }
						    if (strDate >= 0 && strDate <= 9) {
						        strDate = "0" + strDate;
						    }
						    var currentdate = year + seperator1 + month + seperator1 + strDate
						            + " " + date.getHours() + seperator2 + date.getMinutes()
						            + seperator2 + date.getSeconds();
						    return currentdate;
						}
	   		 })(window,jQuery);
			</script>
		  <%-- <script src="<%=path%>/js/prototype.js" type="text/javascript"></script> 
			<script src="<%=path%>/js/scriptaculous.js?load=effects" type="text/javascript"></script>
			<script src="<%=path%>/js/lightbox.js" type="text/javascript"></script> --%>
            
	</body>
</html>